﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GeekShop.Commands;
using System.Drawing;

namespace GeekShop.Tools.ColorPicker
{
    public class SolidColor : MouseBehaviour, ITool
    {
        #region Fields
        private ICommand command = null;
        #endregion

        #region Properties
        public System.Windows.Forms.Cursor Cursor
        {
            get { return Cursors.IBeam; }
        }
        public System.Drawing.Bitmap Icon
        {
            get
            {
                Bitmap icon = (Bitmap)GeekShop.Properties.Resources.color_gradient.Clone();
                Graphics g = Graphics.FromImage(icon);
                g.FillRectangle(new SolidBrush(ColorDialog.Form == null ? Color.Black : ColorDialog.Form.Color), 4, 4, 14, 14);
                return icon;
            }
        }
        public string Name
        {
            get { return "Color Picker"; }
        }
        public ICommand Command { get { return this.command; } }
        #endregion

        #region Methods
        public void RunDialog(PictureManager pictureManager)
        {
            if (ColorDialog.Form == null)
            {
                ColorDialog.Form = new ColorDialog();
            }
            ColorDialog.Form.RunDialog();
        }
        #endregion

        #region Events
        public event EventHandler ToolReady;
        #endregion

        #region Event Methods
        public override void MouseMove(object sender, MouseEventArgs e) { }
        public override void MouseUp(object sender, MouseEventArgs e) { }
        #endregion
    }
}
